<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="https://unpkg.com/vue@next"></script>
    <div id="app">
        <!-- 带属性的v-model -->
        <todo-item v-model:modify-name.aaa="modifyName"></todo-item>
    </div>
    <script>
        const vueOpt = {
            data(){
                return {
                    modifyName: "kenny.bai"
                }
            }
        }

        const app = Vue.createApp(vueOpt);

        app.component('todo-item', {
            data(){
                return {

                }
            },

            methods: {
                changeInput(e){
                    console.log('e:', e);
                    this.$emit('update:modifyName', e.target.value);
                }
            },

            template: `
                <div>
                    <input type="text" :value="modifyName" @input="changeInput">
                </div>
            `,

            props: {
                modifyName: String,
                modifyNameModifiers: {
                    default: ()=>({})
                }
            },

            created(){
                console.log(this.modifyNameModifiers);
            }
        });

        app.mount('#app');

    </script>
</body>
</html>